package com.j.lemon.learn.basic.date;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class DateTest {
    public static void main(String[] args) {
        Date date = new Date();
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        Date d=null;
        try {
            d=simpleDateFormat.parse("2013-09-09");
        } catch (ParseException e) {
            e.printStackTrace();
        }
        String dat=simpleDateFormat.format(date);
        System.out.println(dat);
        System.out.println(d.toString());


        Calendar calendar = Calendar.getInstance();
        calendar.set(Calendar.YEAR,1991);
        calendar.set(Calendar.MONTH,1);
        calendar.set(Calendar.DATE,24);
        System.out.println(calendar.toString());
        System.out.println(calendar.get(Calendar.DAY_OF_WEEK));
        Date cd = calendar.getTime();
        String cddate=simpleDateFormat.format(cd);
        System.out.println(cddate);

        System.out.println(Integer.toBinaryString(100));

        String t = "-10";
        int a = Integer.valueOf(t);
        System.out.println(a);

    }
}
